package org.javaboy.storage.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.javaboy.storage.model.Commodity;

@Mapper
public interface StorageMapper {
    @Select("select id,commodity_code as commodityCode,count,freeze from storage_tbl where commodity_code = #{commodityCode}")
    Commodity getCommodity(Integer commodityCode);


    @Update("update storage_tbl set count = #{count},freeze=#{freeze} where commodity_code = #{commodityCode}")
    int deduce(Commodity commodity);
}
